require flex-tester/tester-syntax.f
require flex-tester/xtester.f

require ../src/phrase-to-path.fs


( prefix-chars )

create tbuf 80 chars allot
T{ tbuf 80 s" foo" prefix-chars => tbuf 80 3 /string }T
	T{ tbuf 3 => T" foo" }T
T{ tbuf 3 s" bar" prefix-chars => tbuf 3 chars + 0 }T
	T{ tbuf 3 => T" bar" }T
T{ tbuf 3 s" quux" ' prefix-chars catch 0= => ?? ?? ?? ?? false }T
	T{ tbuf 3 => T" bar" }T  \ contents unchanged


( phrase>path )

T{ s" foo bar" tbuf 80 phrase>path => T" foo/bar" }T
T{ s" 2dup char-" tbuf 80 phrase>path => T" 2dup/char-minus" }T
T{ s" ]] .(" tbuf 80 phrase>path => T" rbracket-rbracket/dot-paren" }T
